package com.xinqi.modules.course.clazz.thread;

import com.xinqi.common.base.user.Account;
import com.xinqi.modules.course.clazz.service.impl.ClassMqService;
import com.xinqi.modules.course.clazz.thread.dto.ClassStudentRemindDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: wenjie
 * @date: 2023/7/6 21:44
 */

@Service("classMessageSyncService")
@RequiredArgsConstructor
public class ClassMessageSyncService {

    private final ClassMqService classMqService;

    public void batchSyncSendMessage(Long classId, List<ClassStudentRemindDTO> studentList, Account user) {
        studentList.forEach(student -> classMqService.studentQuitClass(classId, student.getStudentId(), student.getStudentName(), user));
    }
}
